%%HTML
<script>
// Hide code cells by default.
var HIDE_CODE_CELLS = true;
function toggle_code_cells() {
if (HIDE_CODE_CELLS){
$('div.input').hide();
} else {
$('div.input').show();
}
HIDE_CODE_CELLS = !HIDE_CODE_CELLS;
}
$(document).ready(toggle_code_cells);
</script>
<a href="javascript:toggle_code_cells()">[Toggle Code Cells]</a>
The 2016 MC Znn signal sample (ZH_HToBB_ZToNuNu_M125_13TeV_powheg_pythia8) was ntuplized using HeppyV25 for the 2016 analysis. A copy of this ntuple is stored under the following EOS directory at cmslpc:
root://cmseos.fnal.gov///store/group/lpchbb/HeppyNtuples/V25/ZH_HToBB_ZToNuNu_M125_13TeV_powheg_pythia8/
For the 2017 analysis, the ntuple format has been migrated to NanoAOD. To compare the two formats and validate important distributions, Stephane has ntuplized a small portion of the 2016 MC Znn signal sample using NanoAOD. These can be located using CMSDAS at the following link. The NanoAOD post-processed ntuples used corresponds to the "NanoPost4" CRAB submission.
The HeppyV25 and NanoAOD ntuples have been hadded and stored on EOS at cmslpc. You may find them at:
For the comparison, the histograms are normalized by their respective integrals in lieu of a target luminosity because I'm unsure of how to retrieve the number of positively and negatively weighted events over the entire MC sample from a NanoAOD ntuple.
All the events are weighted only by the expression "sign(genWeight)".
A baseline selection is applied to both ntuples to enable a cursory first order comparison. This selection consists of the following cuts:
import uuid
import ROOT
import cms_figure
%jsroot on
def histogram(self, variable, nbins, xmin, xmax, weights='', norm=True):
"""Create and return a ROOT histogram from a TTree.
This method is dynamically patched onto the ROOT.TTree class.
Parameters
----------
tree : ROOT.TTree
The TTree containing the branches used to generate the histogram.
variable : str
The variable for which the histogram is created. This can also be
a valid TTreeFormula.
nbins : int
The number of bins.
xmin : int
The value of the lower edge of the first bin.
xmax : int
The value of the upper edge of the last bin.
weights : str, optional
The event weights or selection of events. The default is no weight.
norm : bool, optional
The flag for normalizing the histogram by its integral. The default is True.
"""
name = uuid.uuid4().hex
self.Draw('{variable}>>{name}({nbins!s}, {xmin!s}, {xmax!s})'.format(**locals()), weights, 'goff')
h = ROOT.gDirectory.Get(name)
h.SetTitle('')
if norm:
h.Scale(1. / h.Integral())
h.SetDirectory(0)
return h
ROOT.TTree.histogram = histogram
def select(self, selection):
"""Create and set an eventlist for a TTree.
If an eventlist already exists, the new eventlist is
created from the subset of events in the current eventlist.
This method is dynamically patched onto the ROOT.TTree class.
Parameters
----------
name : str
The name of the histogram. Because the histograms are created in the
same global directory, their names should be unique.
selection : str
The selection expression.
Returns
-------
self : This enables method chaining.
"""
name = uuid.uuid4().hex
self.Draw('>>{0}'.format(name), selection, 'goff')
eventlist = ROOT.gDirectory.Get(name)
eventlist.SetDirectory(0)
if self.GetEventList():
eventlist.Intersect(self.GetEventList())
self.SetEventList(eventlist)
return self
ROOT.TTree.select = select
# Load the HeppyV25 tree.
f_heppy = ROOT.TFile.Open('root://cmseos.fnal.gov///store/user/sjwang/ZnnHbb_Ntuple_Validation/Znn_HeppyV25.root')
tree_heppy = f_heppy.Get('tree')
print 'The HeppyV25 ntuple contains {0!s} total unweighted events.'.format(tree_heppy.GetEntriesFast())
# Load the NanoAOD tree.
f_nano = ROOT.TFile.Open('root://cmseos.fnal.gov///store/user/sjwang/ZnnHbb_Ntuple_Validation/Znn_NanoPost4.root')
tree_nano = f_nano.Get('Events')
print 'The NanoAOD ntuple contains {0!s} total unweighted events.'.format(tree_nano.GetEntriesFast())
# Apply baseline selection to HeppyV25 ntuple.
(tree_heppy.select('Vtype == 2 || Vtype == 3 || Vtype == 4')
.select('met_pt > 150')
.select('HCMVAV2_mass > 0')
.select('Flag_goodVertices'
'&& Flag_GlobalTightHalo2016Filter'
'&& Flag_HBHENoiseFilter'
'&& Flag_HBHENoiseIsoFilter'
'&& Flag_EcalDeadCellTriggerPrimitiveFilter')
);
# Apply baseline selection to NanoAOD ntuple.
(tree_nano.select('Vtype == 2 || Vtype == 3 || Vtype == 4')
.select('MET_pt > 150')
.select('H_mass > 0')
.select('Flag_goodVertices'
'&& Flag_globalTightHalo2016Filter'
'&& Flag_HBHENoiseFilter'
'&& Flag_HBHENoiseIsoFilter'
'&& Flag_EcalDeadCellTriggerPrimitiveFilter')
);
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('GenVbosons_pt', 50, 0, 500, weights='sign(genWeight)*(GenVbosons_pdgId==23)')
hist_nano = tree_nano.histogram('GenPart_pt', 50, 0, 500, weights='sign(genWeight)*(GenPart_status==62 && GenPart_pdgId==23)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('p_{T}^{gen}(V) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('lheV_pt', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('LHE_Vpt', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('LHE p_{T}(V) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('lheHT', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('LHE_HT', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('LHE HT [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('met_pt', 40, 100, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('MET_pt', 40, 100, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('MET [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('met_phi', 32, -3.2, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('MET_phi', 32, -3.2, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#phi(MET)')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('HCMVAV2_mass', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('H_mass', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('m(jj) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('HCMVAV2_pt', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('H_pt', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('p_{T}(jj) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('HCMVAV2_phi', 32, -3.2, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('H_phi', 32, -3.2, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#phi(jj)')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('HCMVAV2_eta', 50, -5, 5, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('H_eta', 50, -5, 5, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#eta(jj)')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('hJCMVAV2idx[0]', 10, 0, 10, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('hJidx[0]', 10, 0, 10, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('Higgs Jet 1 Index')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_pt[hJCMVAV2idx[0]]', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_pt[hJidx[0]]', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('p_{T}(j_{1}) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_phi[hJCMVAV2idx[0]]', 32, -3.2, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_phi[hJidx[0]]', 32, -3.2, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#phi(j_{1})')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_eta[hJCMVAV2idx[0]]', 50, -5, 5, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_eta[hJidx[0]]', 50, -5, 5, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#eta(j_{1})')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_btagCMVAV2[hJCMVAV2idx[0]]', 100, -1, 1, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_btagCMVA[hJidx[0]]', 100, -1, 1, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('CMVA_{max}')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('hJCMVAV2idx[1]', 10, 0, 10, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('hJidx[1]', 10, 0, 10, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('Higgs Jet 2 Index')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_pt[hJCMVAV2idx[1]]', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_pt[hJidx[1]]', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('p_{T}(j_{2}) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_phi[hJCMVAV2idx[1]]', 32, -3.2, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_phi[hJidx[1]]', 32, -3.2, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.3
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#phi(j_{2})')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_eta[hJCMVAV2idx[1]]', 50, -5, 5, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_eta[hJidx[1]]', 50, -5, 5, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#eta(j_{2})')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Jet_btagCMVAV2[hJCMVAV2idx[1]]', 100, -1, 1, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Jet_btagCMVA[hJidx[1]]', 100, -1, 1, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('CMVA_{min}')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('abs(TVector2::Phi_mpi_pi(HCMVAV2_phi-met_phi))', 32, 0, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('abs(TVector2::Phi_mpi_pi(H_phi-MET_phi))', 32, 0, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.3
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#||{#Delta#phi(V, jj)}')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('(Jet_eta[hJCMVAV2idx[0]]-Jet_eta[hJCMVAV2idx[1]])', 50, -5, 5, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('(Jet_eta[hJidx[0]]-Jet_eta[hJidx[1]])', 50, -5, 5, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#Delta#eta(jj)')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('abs(TVector2::Phi_mpi_pi(Jet_phi[hJCMVAV2idx[0]]-Jet_phi[hJCMVAV2idx[1]]))', 32, 0, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('abs(TVector2::Phi_mpi_pi(Jet_phi[hJidx[0]]-Jet_phi[hJidx[1]]))', 32, 0, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#Delta#phi(jj)')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('((Jet_eta[hJCMVAV2idx[0]]-Jet_eta[hJCMVAV2idx[1]])**2 + (TVector2::Phi_mpi_pi(Jet_phi[hJCMVAV2idx[0]]-Jet_phi[hJCMVAV2idx[1]]))**2)**0.5', 50, 0, 5, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('((Jet_eta[hJidx[0]]-Jet_eta[hJidx[1]])**2 + (TVector2::Phi_mpi_pi(Jet_phi[hJidx[0]]-Jet_phi[hJidx[1]]))**2)**0.5', 50, 0, 5, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('#DeltaR(jj)')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Sum$(Jet_pt>30 && abs(Jet_eta)<2.4 && Jet_id>0 && Jet_puId>0)', 10, 0, 10, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Sum$(Jet_pt>30 && abs(Jet_eta)<2.4 && Jet_jetId>0 && Jet_puId>0)', 10, 0, 10, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('N_{j}')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('Sum$(Jet_pt>30 && abs(Jet_eta)<2.4 && Jet_id>0 && Jet_puId>0 && Iteration$!=hJCMVAV2idx[0] && Iteration$!=hJCMVAV2idx[1])', 8, 0, 8, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('Sum$(Jet_pt>30 && abs(Jet_eta)<2.4 && Jet_jetId>0 && Jet_puId>0 && Iteration$!=hJidx[0] && Iteration$!=hJidx[1])', 8, 0, 8, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('N_{aj}')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('MinIf$(abs(TVector2::Phi_mpi_pi(Jet_phi-met_phi)), Jet_pt>30 && Jet_id>0 && Jet_puId>0)', 32, 0, 3.2, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('MinIf$(abs(TVector2::Phi_mpi_pi(Jet_phi-MET_phi)), Jet_pt>30 && Jet_jetId>0 && Jet_puId>0)', 32, 0, 3.2, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.3
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('min #||{#Delta#phi(MET, j)}')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('nPVs', 50, 0, 50, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('PV_npvs', 50, 0, 50, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('# Primary Vertices')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()
with cms_figure.TDRStyle() as style:
# It appears some style options need to be adjusted to look nicer for jsroot.
style.SetLabelSize(0.035, 'XYZ')
style.SetTitleSize(0.035, 'XYZ')
style.SetTitleOffset(1.5, 'X')
style.SetTitleOffset(1.8, 'Y')
canvas = ROOT.TCanvas()
canvas.SetRightMargin(0.08)
# Create, style, and plot the histograms.
hist_heppy = tree_heppy.histogram('MaxIf$(Jet_pt, Iteration$!=hJCMVAV2idx[0] && Iteration$!=hJCMVAV2idx[1])', 50, 0, 500, weights='sign(genWeight)')
hist_nano = tree_nano.histogram('MaxIf$(Jet_pt, Iteration$!=hJidx[0] && Iteration$!=hJidx[1])', 50, 0, 500, weights='sign(genWeight)')
y_max = max(hist_heppy.GetMaximum(), hist_nano.GetMaximum()) * 1.2
hist_heppy.SetMaximum(y_max)
hist_heppy.SetMinimum(0)
hist_heppy.SetFillColorAlpha(ROOT.kBlue, 0.35)
hist_heppy.SetXTitle('max p_{T}(aj) [GeV]')
hist_heppy.SetYTitle('A.U.')
hist_heppy.Draw('hist')
hist_nano.SetFillColorAlpha(ROOT.kRed, 0.35)
hist_nano.Draw('histsame')
# Create and plot legend and labels.
legend = ROOT.TLegend(0.65, 0.8, 0.9, 0.9)
legend.SetBorderSize(0)
legend.SetShadowColor(0)
legend.SetTextSize(0.03)
legend.AddEntry(hist_heppy, 'HeppyV25', 'f')
legend.AddEntry(hist_nano, 'NanoAOD', 'f')
legend.Draw()
cms_figure.draw_labels('', extra_text='Simulation')
canvas.Draw()